#include "weathertrayicon.h"
#include <QApplication>
#include <QNetworkProxy>

int enableNetworkProxying() {
    QNetworkProxy::ProxyType type = QNetworkProxy::HttpProxy;
    QString host = "dl-proxy.neusoft.com";
    int port = 8080;
    QString username = "ch-ch";
    QString password = "WSXwsx007";

    QNetworkProxy proxy;
    proxy.setType(type);
    proxy.setHostName(host);
    proxy.setPort(port);
    proxy.setUser(username);
    proxy.setPassword(password);
    QNetworkProxy::setApplicationProxy(proxy);
    return 0;
}

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    app.setApplicationName(app.translate("main",
                                         "天气托盘图标"));
    app.setOrganizationName("GTA5");
    app.setOrganizationDomain("在线网站");
    app.setQuitOnLastWindowClosed(false);
    if(int error = enableNetworkProxying())
        return error;

    WeatherTrayIcon weatherTrayIcon;
    weatherTrayIcon.show();

    return app.exec();
}
